Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types

نویسندگان

  • Andreas Abel
  • James Chapman
چکیده

In this paper we present an Agda formalization of a normalizer for simply-typed lambda terms. The first step is to write a coinductive evaluator using the delay monad. The other component of the normalizer, a type-directed reifier from values to η-long β -normal forms, resides in the delay monad as well. Their composition, normalization-by-evaluation, is shown to be a total function, using a standard logical-relations argument. The successful formalization serves as a proof-of-concept for coinductive programming and proving using sized types and copatterns, a new and presently experimental feature of Agda.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Normalization by Evaluation in the Delay Monad

We present an Agda formalization of a normalization proof for simply-typed lambda terms. The normalizer consists of two coinductively defined functions in the delay monad: One is a standard evaluator of lambda terms to closures, the other a type-directed reifier from values to η-long β-normal forms. Their composition, normalization-by-evaluation, is shown to be a total function a posteriori, us...

متن کامل

Well-founded recursion with copatterns and sized types

In this paper, we study strong normalization of a core language based on System Fω which supports programming with finite and infinite structures. Finite data such as finite lists and trees is defined via constructors and manipulated via pattern matching, while infinite data such as streams and infinite trees is defined by observations and synthesized via copattern matching. Taking a type-based...

متن کامل

A Unified Approach to Termination and Productivity

In this paper, we study strong normalization of a core language based on System F-omega which supports programming with finite and infinite structures. Building on our prior work, finite data such as finite lists and trees are defined via constructors and manipulated via pattern matching, while infinite data such as streams and infinite trees is defined by observations and synthesized via copat...

متن کامل

Programming and Reasoning with Infinite Structures Using Copatterns and Sized Types

Inductive data such as lists and trees is modeled category-theoretically as algebra where construction is the primary concept and elimination is obtained by initiality. In a more practical setting, functions are programmed by pattern matching on inductive data. Dually, coinductive structures such as streams and processes are modeled as coalgebras where destruction (or transition) is primary and...

متن کامل

Indexed copatterns: reasoning about infinite structures by observations

Reasoning about finite data such as lists or even lambda terms is well understood and programming languages and proof systems o↵er extensive support to inductively define such finite data. Beyond encoding such structures in a simply typed setting, indexing types allows us to enforce even more precise invariants about inductive objects; for example, we may index lists with their length to reason...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014